package com.bite.springbook.Dao;

import com.bite.springbook.Model.BookInfo;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Repository
public class BookDao {
    List<BookInfo> BookInfos = new ArrayList<>();
    public List<BookInfo> mockData(){

        for (int i = 0; i <= 15; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setBookName("图书" + i);
            bookInfo.setAuthor("作者" + i);
            bookInfo.setCount(i + 5);
            bookInfo.setPrice(new BigDecimal(i * 3));
            bookInfo.setPublish("出版社" + i);
            if(i % 5 == 0){
                bookInfo.setStatus(1);
               // bookInfo.setStatusCN("不可借阅");
            }else{
                bookInfo.setStatus(2);
                //bookInfo.setStatusCN("可借阅");
            }
            BookInfos.add(bookInfo);
        }
        return BookInfos;
    }
}
